home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / winexit / winexit.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-08-26  |  4.1 KB  |  149 lines

  1. VERSION 2.00
  2. Begin Form frmWinExit 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Exit Windows"
  6.    ClientHeight    =   2145
  7.    ClientLeft      =   2115
  8.    ClientTop       =   1980
  9.    ClientWidth     =   2055
  10.    Height          =   2835
  11.    Icon            =   WINEXIT.FRX:0000
  12.    Left            =   2055
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   2145
  16.    ScaleWidth      =   2055
  17.    Top             =   1350
  18.    Width           =   2175
  19.    Begin CommandButton cmdCancel 
  20.       BackColor       =   &H00C0C0C0&
  21.       Cancel          =   -1  'True
  22.       Caption         =   "Cancel"
  23.       Height          =   315
  24.       Left            =   720
  25.       TabIndex        =   5
  26.       Top             =   1740
  27.       Width           =   1215
  28.    End
  29.    Begin OptionButton optChoice 
  30.       BackColor       =   &H00C0C0C0&
  31.       Caption         =   "Exit && Reboot"
  32.       Height          =   315
  33.       Index           =   2
  34.       Left            =   180
  35.       TabIndex        =   2
  36.       Top             =   960
  37.       Width           =   1575
  38.    End
  39.    Begin OptionButton optChoice 
  40.       BackColor       =   &H00C0C0C0&
  41.       Caption         =   "Restart Windows"
  42.       Height          =   315
  43.       Index           =   1
  44.       Left            =   180
  45.       TabIndex        =   1
  46.       Top             =   540
  47.       Width           =   1755
  48.    End
  49.    Begin OptionButton optChoice 
  50.       BackColor       =   &H00C0C0C0&
  51.       Caption         =   "Exit Windows"
  52.       Height          =   315
  53.       Index           =   0
  54.       Left            =   180
  55.       TabIndex        =   0
  56.       Top             =   120
  57.       Value           =   -1  'True
  58.       Width           =   1515
  59.    End
  60.    Begin PictureBox picOpenDoor 
  61.       AutoSize        =   -1  'True
  62.       BackColor       =   &H00C0C0C0&
  63.       BorderStyle     =   0  'None
  64.       Height          =   480
  65.       Left            =   120
  66.       Picture         =   WINEXIT.FRX:0302
  67.       ScaleHeight     =   480
  68.       ScaleWidth      =   480
  69.       TabIndex        =   4
  70.       TabStop         =   0   'False
  71.       Top             =   1500
  72.       Width           =   480
  73.    End
  74.    Begin CommandButton cmdOK 
  75.       BackColor       =   &H00C0C0C0&
  76.       Caption         =   "OK"
  77.       Default         =   -1  'True
  78.       Height          =   315
  79.       Left            =   720
  80.       TabIndex        =   3
  81.       Top             =   1380
  82.       Width           =   1215
  83.    End
  84.    Begin Menu mnuOptions 
  85.       Caption         =   "&Options"
  86.       Begin Menu mnuExit 
  87.          Caption         =   "E&xit"
  88.       End
  89.       Begin Menu mnuRestart 
  90.          Caption         =   "&Restart"
  91.       End
  92.       Begin Menu mnuReboot 
  93.          Caption         =   "Exit && Re&boot"
  94.       End
  95.    End
  96.    Begin Menu mnuAbout 
  97.       Caption         =   "&About"
  98.    End
  99. Option Explicit
  100. Sub cmdCancel_Click ()
  101.     End
  102. End Sub
  103. Sub cmdOK_Click ()
  104.     If optChoice(0).Value Then
  105.         Call WinExit(0)
  106.     ElseIf optChoice(1).Value Then
  107.         Call WinExit(1)
  108.     ElseIf optChoice(2).Value Then
  109.         Call WinExit(2)
  110.     End If
  111. End Sub
  112. Sub Form_Load ()
  113.     If UCase$(Command$) = "EXIT" Then
  114.         optChoice(0).Value = True
  115.         WinExit (0)
  116.     ElseIf UCase$(Command$) = "RESTART" Then
  117.         optChoice(1).Value = True
  118.         WinExit (1)
  119.     ElseIf UCase$(Command$) = "REBOOT" Then
  120.         optChoice(2).Value = True
  121.         WinExit (2)
  122.     End If
  123.     CentreForm Me
  124. End Sub
  125. Sub Form_Paint ()
  126.     MakeForm3D Me
  127. End Sub
  128. Sub Form_Resize ()
  129.     ' Don't let the user resize the form
  130.     ' i've made the form sizable as if you use menu
  131.     ' you can't have a fixed double border
  132.     If windowstate <> 1 Then
  133.         width = 2130
  134.         height = 2835
  135.     End If
  136. End Sub
  137. Sub mnuAbout_Click ()
  138.     frmAbout.Show 1
  139. End Sub
  140. Sub mnuExit_Click ()
  141.     Call WinExit(0)
  142. End Sub
  143. Sub mnuReboot_Click ()
  144.     Call WinExit(2)
  145. End Sub
  146. Sub mnuRestart_Click ()
  147.     Call WinExit(1)
  148. End Sub
  149.